<?php
require_once '../sub/init.php';
require_once ZEAI.'sub/conn.php';
$nodatatips = "<div class='nodatatips'><i class='ico'>&#xe608;</i>暂时木有内容</div>";
if($submitok == 'ajax_get_list')exit(get_list());
$headertitle = '情感测试-'.$_ZEAI['siteName'];$nav='lovetest';?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $headertitle;?></title>
<?php echo HEADMETA; ?>
<meta name="x5-orientation" content="portrait">
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo RES;?>m/css/qinggan.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo HOST;?>/cache/zeaicolor.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
body{background-color:#f5f5f5}
#backtop a{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
/*topnav*/
.topnav1{background-image:url("<?php echo RES;?>m/img/my_bg.png");background-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.topnav a.ed:after{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.topnav1 a.ed:after{background-color:#fff}
</style>
</head>
<body>
<?php if ($_ZEAI['m_mb']==2){$TRnav_btn = 'hide';$mainstyle=' style="margin-top:0"';require_once ZEAI.'m/top2.php';}else{ ?>
<div class="topnav<?php echo ($_ZEAI['m_mb']==1)?' topnav1':'';?>">
    <a href="trend.php" class="ed">情感测试</a>
</div>
<?php }?>
<div class="article">
	<div class="articlelist">
	<?php
    $rt2=$db->query("SELECT id,title,ftitle,path_s FROM ".__TBL_LOVETEST_BANK__." WHERE path_s<>'' ORDER BY px DESC,id DESC");
	$total2 = $db->num_rows($rt2);
	if ($total2 > 0) {
		for($j=0;$j<$total2;$j++) {
			$rows2 = $db->fetch_array($rt2,'name');
			if(!$rows2) break;
			$id   = $rows2['id'];
			$title=dataIO($rows2['title'],'out');
			$ftitle=dataIO($rows2['ftitle'],'out');
			$path_s    = $rows2['path_s'];
			$path_s_url = UP.$path_s;?>
            <a href="qinggan_ifpay.php?fid=<?php echo $id;?>">
                <img src="<?php echo $path_s_url;?>" />
                <h2><?php echo $title;?></h2>
                <p><?php echo $ftitle;?></p>
                <button class="btn size3 W80_ yuan zeaibg">开始评估</button>
            </a><?php
		}
	}else{
		return $nodatatips;
	}?>
    </div>
</div>
<div id="backtop"><a href="#top" id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<?php
require_once ZEAI.'m/TRnav.php';
if($_ZEAI['m_mb']==2){
	echo "<script>setTimeout(function(){hdnavLRmoveFn(hdnav,180,'r');},100);</script>";
	require_once ZEAI.'m/bottom2.php';
}else{
	require_once ZEAI.'m/bottom.php';
}
function get_list() {
	global $db,$_ZEAI,$nodatatips;
	$rt2=$db->query("SELECT id,title FROM ".__TBL_LOVETEST_BANK__." ORDER BY px DESC,id DESC");
	$total2 = $db->num_rows($rt2);
	if ($total2 > 0) {
		for($j=0;$j<$total2;$j++) {
			$rows2 = $db->fetch_array($rt2,'name');
			if(!$rows2) break;
			$id   = $rows2['id'];
			$title=dataIO($rows2['title'],'out');
			$title = gylsubstr($title,38,0,"utf-8",true);
			$echo .= '<a href="qinggan_detail.php?fid='.$id.'">';
			$echo .= '<h4>'.$title.'</h4>';
			$echo .= '</a>';
		}
		return $echo;
	}else{
		return $nodatatips;
	}
}
?>